<a href='https://github.com/angular/angular.js/edit/v1.5.x/src/ng/httpBackend.js?message=docs($xhrFactory)%3A%20describe%20your%20change...#L3' class='improve-docs btn btn-primary'><i class="glyphicon glyphicon-edit">&nbsp;</i>Improve this Doc</a>



<a href='https://github.com/angular/angular.js/tree/v1.5.8/src/ng/httpBackend.js#L3' class='view-source pull-right btn btn-primary'>
  <i class="glyphicon glyphicon-zoom-in">&nbsp;</i>View Source
</a>


<header class="api-profile-header">
  <h1 class="api-profile-header-heading">$xhrFactory</h1>
  <ol class="api-profile-header-structure naked-list step-list">
    
  

    <li>
      - service in module <a href="api/ng">ng</a>
    </li>
  </ol>
</header>



<div class="api-profile-description">
  <p>Factory function used to create XMLHttpRequest objects.</p>
<p>Replace or decorate this service to create your own custom XMLHttpRequest objects.</p>
<pre><code>angular.module(&#39;myApp&#39;, [])
.factory(&#39;$xhrFactory&#39;, function() {
  return function createXhr(method, url) {
    return new window.XMLHttpRequest({mozSystem: true});
  };
});
</code></pre>

</div>






<div>
  

    

  <h2 id="usage">Usage</h2>
    
      <p><code>$xhrFactory(method, url);</code></p>


    

    
<section class="api-section">
  <h3>Arguments</h3>

<table class="variables-matrix input-arguments">
  <thead>
    <tr>
      <th>Param</th>
      <th>Type</th>
      <th>Details</th>
    </tr>
  </thead>
  <tbody>
    
    <tr>
      <td>
        method
        
        
      </td>
      <td>
        <a href="" class="label type-hint type-hint-string">string</a>
      </td>
      <td>
        <p>HTTP method of the request (GET, POST, PUT, ..)</p>

        
      </td>
    </tr>
    
    <tr>
      <td>
        url
        
        
      </td>
      <td>
        <a href="" class="label type-hint type-hint-string">string</a>
      </td>
      <td>
        <p>URL of the request.</p>

        
      </td>
    </tr>
    
  </tbody>
</table>

</section>
    
    

  
  
  



  
</div>


